home *** CD-ROM | disk | FTP | other *** search
/ BMUG Newsletter 1996 Spring / S96 NL CD.iso / New NL PD Collections / Sound Manager 3.1 / For Programmers / Interfaces / Sound.p < prev    next >
Encoding:
Text File  |  1995-08-24  |  20.8 KB  |  631 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        Sound.p
  3.  
  4.      Contains:    Sound Manager Interfaces.
  5.  
  6.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  7.                  All rights reserved.
  8.  
  9.      Bugs:        Report bugs to Radar component “System Interfaces”, “Latest”
  10.  
  11. }
  12.  
  13. {$IFC UNDEFINED UsingIncludes}
  14. {$SETC UsingIncludes := 0}
  15. {$ENDC}
  16.  
  17. {$IFC NOT UsingIncludes}
  18.  UNIT Sound;
  19.  INTERFACE
  20. {$ENDC}
  21.  
  22. {$IFC UNDEFINED __SOUND__}
  23. {$SETC __SOUND__ := 1}
  24.  
  25. {$I+}
  26. {$SETC SoundIncludes := UsingIncludes}
  27. {$SETC UsingIncludes := 1}
  28.  
  29.  
  30. {$IFC UNDEFINED __TYPES__}
  31. {$I Types.p}
  32. {$ENDC}
  33. {    ConditionalMacros.p                                            }
  34.  
  35. {$IFC UNDEFINED __COMPONENTS__}
  36. {$I Components.p}
  37. {$ENDC}
  38. {    MixedMode.p                                                    }
  39.  
  40. {$IFC UNDEFINED __MIXEDMODE__}
  41. {$I MixedMode.p}
  42. {$ENDC}
  43.  
  44. {$PUSH}
  45. {$ALIGN MAC68K}
  46. {$LibExport+}
  47. {
  48.                         * * *  N O T E  * * *
  49.  
  50.     This file has been updated to include Sound Manager 3.1 interfaces.
  51.  
  52.     Some of the Sound Manager 3.0 interfaces were not put into the InterfaceLib
  53.     that originally shipped with the PowerMacs. These missing functions and the
  54.     new 3.1 interfaces have been released in the SoundLib library for PowerPC
  55.     developers to link with. The runtime library for these functions are
  56.     installed by Sound Manager 3.1. The following functions are found in SoundLib.
  57.  
  58.         GetCompressionInfo, GetSoundPreference, SetSoundPreference,
  59.         UnsignedFixedMulDiv, SndGetInfo, SndSetInfo
  60. }
  61. {
  62.     Interfaces for Sound Driver, !!! OBSOLETE and NOT SUPPORTED !!!
  63.  
  64.     These items are no longer defined, but appear here so that someone
  65.     searching the interfaces might find them. If you are using one of these
  66.     items, you must change your code to support the Sound Manager.
  67.  
  68.         swMode, ftMode, ffMode
  69.         FreeWave, FFSynthRec, Tone, SWSynthRec, Wave, FTSoundRec
  70.         SndCompletionProcPtr
  71.         StartSound, StopSound, SoundDone
  72. }
  73. CONST
  74.     twelfthRootTwo                = 1.05946309434;
  75.     soundListRsrc                = 'snd ';                        {Resource type used by Sound Manager}
  76.     rate44khz                    = $AC440000;                    {44100.00000 in fixed-point}
  77.     rate22050hz                    = $56220000;                    {22050.00000 in fixed-point}
  78.     rate22khz                    = $56EE8BA3;                    {22254.54545 in fixed-point}
  79.     rate11khz                    = $2B7745D1;                    {11127.27273 in fixed-point}
  80.     rate11025hz                    = $2B110000;                    {11025.00000 in fixed-point}
  81. {synthesizer numbers for SndNewChannel}
  82.     squareWaveSynth                = 1;                            {square wave synthesizer}
  83.     waveTableSynth                = 3;                            {wave table synthesizer}
  84.     sampledSynth                = 5;                            {sampled sound synthesizer}
  85. {old Sound Manager MACE synthesizer numbers}
  86.     MACE3snthID                    = 11;
  87.     MACE6snthID                    = 13;
  88.     kMiddleC                    = 60;                            {MIDI note value for middle C}
  89.     kSimpleBeepID                = 1;                            {reserved resource ID for Simple Beep}
  90.     kFullVolume                    = $0100;                        {1.0, setting for full hardware output volume}
  91.     kNoVolume                    = 0;                            {setting for no sound volume}
  92. {command numbers for SndDoCommand and SndDoImmediate}
  93.     nullCmd                        = 0;
  94.     initCmd                        = 1;
  95.     freeCmd                        = 2;
  96.     quietCmd                    = 3;
  97.     flushCmd                    = 4;
  98.     reInitCmd                    = 5;
  99.     waitCmd                        = 10;
  100.     pauseCmd                    = 11;
  101.     resumeCmd                    = 12;
  102.     callBackCmd                    = 13;
  103.  
  104.     syncCmd                        = 14;
  105.     availableCmd                = 24;
  106.     versionCmd                    = 25;
  107.     totalLoadCmd                = 26;
  108.     loadCmd                        = 27;
  109.     freqDurationCmd                = 40;
  110.     restCmd                        = 41;
  111.     freqCmd                        = 42;
  112.     ampCmd                        = 43;
  113.     timbreCmd                    = 44;
  114.     getAmpCmd                    = 45;
  115.     volumeCmd                    = 46;                            {sound manager 3.0 or later only}
  116.     getVolumeCmd                = 47;                            {sound manager 3.0 or later only}
  117.     waveTableCmd                = 60;
  118.     phaseCmd                    = 61;
  119.  
  120.     soundCmd                    = 80;
  121.     bufferCmd                    = 81;
  122.     rateCmd                        = 82;
  123.     continueCmd                    = 83;
  124.     doubleBufferCmd                = 84;
  125.     getRateCmd                    = 85;
  126.     rateMultiplierCmd            = 86;
  127.     getRateMultiplierCmd        = 87;
  128.     sizeCmd                        = 90;
  129.     convertCmd                    = 91;
  130.     stdQLength                    = 128;
  131.     dataOffsetFlag                = $8000;
  132.  
  133. {channel initialization parameters}
  134. {$IFC OLDROUTINENAMES }
  135.     waveInitChannelMask            = $07;
  136.     waveInitChannel0            = $04;                            {wave table only, Sound Manager 2.0 and earlier}
  137.     waveInitChannel1            = $05;                            {wave table only, Sound Manager 2.0 and earlier}
  138.     waveInitChannel2            = $06;                            {wave table only, Sound Manager 2.0 and earlier}
  139.     waveInitChannel3            = $07;                            {wave table only, Sound Manager 2.0 and earlier}
  140.     initChan0                    = waveInitChannel0;                {obsolete spelling}
  141.     initChan1                    = waveInitChannel1;                {obsolete spelling}
  142.     initChan2                    = waveInitChannel2;                {obsolete spelling}
  143.     initChan3                    = waveInitChannel3;                {obsolete spelling}
  144.  
  145. {$ENDC}
  146.     initChanLeft                = $0002;                        {left stereo channel}
  147.     initChanRight                = $0003;                        {right stereo channel}
  148.     initNoInterp                = $0004;                        {no linear interpolation}
  149.     initNoDrop                    = $0008;                        {no drop-sample conversion}
  150.     initMono                    = $0080;                        {monophonic channel}
  151.     initStereo                    = $00C0;                        {stereo channel}
  152.     initMACE3                    = $0300;                        {MACE 3:1}
  153.     initMACE6                    = $0400;                        {MACE 6:1}
  154.     initPanMask                    = $0003;                        {mask for right/left pan values}
  155.     initSRateMask                = $0030;                        {mask for sample rate values}
  156.     initStereoMask                = $00C0;                        {mask for mono/stereo values}
  157.     initCompMask                = $FF00;                        {mask for compression IDs}
  158.     kUseOptionalOutputDevice    = -1;                            {only for Sound Manager 3.0 or later}
  159.     notCompressed                = 0;                            {compression ID's}
  160.     fixedCompression            = -1;                            {compression ID for fixed-sized compression}
  161.     variableCompression            = -2;                            {compression ID for variable-sized compression}
  162.     twoToOne                    = 1;
  163.     eightToThree                = 2;
  164.     threeToOne                    = 3;
  165.     sixToOne                    = 4;
  166.  
  167.     stdSH                        = $00;                            {Standard sound header encode value}
  168.     extSH                        = $FF;                            {Extended sound header encode value}
  169.     cmpSH                        = $FE;                            {Compressed sound header encode value}
  170.  
  171.     outsideCmpSH                = 0;                            {MACE constants}
  172.     insideCmpSH                    = 1;
  173.     aceSuccess                    = 0;
  174.     aceMemFull                    = 1;
  175.     aceNilBlock                    = 2;
  176.     aceBadComp                    = 3;
  177.     aceBadEncode                = 4;
  178.     aceBadDest                    = 5;
  179.     aceBadCmd                    = 6;
  180.     sixToOnePacketSize            = 8;
  181.     threeToOnePacketSize        = 16;
  182.     stateBlockSize                = 64;
  183.     leftOverBlockSize            = 32;
  184.     firstSoundFormat            = $0001;                        {general sound format}
  185.     secondSoundFormat            = $0002;                        {special sampled sound format (HyperCard)}
  186.     dbBufferReady                = $00000001;                    {double buffer is filled}
  187.     dbLastBuffer                = $00000004;                    {last double buffer to play}
  188.     sysBeepDisable                = $0000;                        {SysBeep() enable flags}
  189.     sysBeepEnable                = 0+(1 * (2**(0)));
  190.     sysBeepSynchronous            = 0+(1 * (2**(1)));                {if bit set, make alert sounds synchronous}
  191.     unitTypeNoSelection            = $FFFF;                        {unitTypes for AudioSelection.unitType}
  192.     unitTypeSeconds                = $0000;
  193.  
  194. { unsigned fixed-point number }
  195.  
  196. TYPE
  197.     UnsignedFixed = LONGINT;
  198.  
  199.     SndCommand = PACKED RECORD
  200.         cmd:                    INTEGER;
  201.         param1:                    INTEGER;
  202.         param2:                    LONGINT;
  203.     END;
  204.  
  205.     SndChannelPtr = ^SndChannel;
  206.  
  207.     SndCallBackProcPtr = ProcPtr;  { PROCEDURE SndCallBack(chan: SndChannelPtr; VAR cmd: SndCommand); }
  208.     SndCallBackUPP = UniversalProcPtr;
  209.  
  210.     SndChannel = PACKED RECORD
  211.         nextChan:                ^SndChannel;
  212.         firstMod:                Ptr;                                    { reserved for the Sound Manager }
  213.         callBack:                SndCallBackUPP;
  214.         userInfo:                LONGINT;
  215.         wait:                    LONGINT;                                { The following is for internal Sound Manager use only.}
  216.         cmdInProgress:            SndCommand;
  217.         flags:                    INTEGER;
  218.         qLength:                INTEGER;
  219.         qHead:                    INTEGER;
  220.         qTail:                    INTEGER;
  221.         queue:                    ARRAY [0..stdQLength-1] OF SndCommand;
  222.     END;
  223.  
  224. {MACE structures}
  225.     StateBlock = RECORD
  226.         stateVar:                ARRAY [0..stateBlockSize-1] OF INTEGER;
  227.     END;
  228.  
  229.     StateBlockPtr = ^StateBlock;
  230.  
  231.     LeftOverBlock = RECORD
  232.         count:                    LONGINT;
  233.         sampleArea:                PACKED ARRAY [0..leftOverBlockSize-1] OF CHAR;
  234.     END;
  235.  
  236.     LeftOverBlockPtr = ^LeftOverBlock;
  237.  
  238.     ModRef = RECORD
  239.         modNumber:                INTEGER;
  240.         modInit:                LONGINT;
  241.     END;
  242.  
  243.     SndListResource = RECORD
  244.         format:                    INTEGER;
  245.         numModifiers:            INTEGER;
  246.         modifierPart:            ARRAY [0..0] OF ModRef;                    {This is a variable length array}
  247.         numCommands:            INTEGER;
  248.         commandPart:            ARRAY [0..0] OF SndCommand;                {This is a variable length array}
  249.         dataPart:                PACKED ARRAY [0..0] OF CHAR;            {This is a variable length array}
  250.     END;
  251.  
  252.     SndListPtr = ^SndListResource;
  253.  
  254.     SndListHndl = ^SndListPtr;
  255.     SndListHandle = ^SndListPtr;
  256.  
  257. {HyperCard sound resource format}
  258.     Snd2ListResource = RECORD
  259.         format:                    INTEGER;
  260.         refCount:                INTEGER;
  261.         numCommands:            INTEGER;
  262.         commandPart:            ARRAY [0..0] OF SndCommand;                {This is a variable length array}
  263.         dataPart:                PACKED ARRAY [0..0] OF CHAR;            {This is a variable length array}
  264.     END;
  265.  
  266.     Snd2ListPtr = ^Snd2ListResource;
  267.  
  268.     Snd2ListHndl = ^Snd2ListPtr;
  269.     Snd2ListHandle = ^Snd2ListPtr;
  270.  
  271.     SoundHeader = PACKED RECORD
  272.         samplePtr:                Ptr;                                    {if NIL then samples are in sampleArea}
  273.         length:                    LONGINT;                                {length of sound in bytes}
  274.         sampleRate:                UnsignedFixed;                            {sample rate for this sound}
  275.         loopStart:                LONGINT;                                {start of looping portion}
  276.         loopEnd:                LONGINT;                                {end of looping portion}
  277.         encode:                    CHAR;                                    {header encoding}
  278.         baseFrequency:            CHAR;                                    {baseFrequency value}
  279.         sampleArea:                PACKED ARRAY [0..0] OF CHAR;            {space for when samples follow directly}
  280.     END;
  281.  
  282.     SoundHeaderPtr = ^SoundHeader;
  283.  
  284.     CmpSoundHeader = PACKED RECORD
  285.         samplePtr:                Ptr;                                    {if nil then samples are in sample area}
  286.         numChannels:            LONGINT;                                {number of channels i.e. mono = 1}
  287.         sampleRate:                UnsignedFixed;                            {sample rate in Apples Fixed point representation}
  288.         loopStart:                LONGINT;                                {loopStart of sound before compression}
  289.         loopEnd:                LONGINT;                                {loopEnd of sound before compression}
  290.         encode:                    CHAR;                                    {data structure used , stdSH, extSH, or cmpSH}
  291.         baseFrequency:            CHAR;                                    {same meaning as regular SoundHeader}
  292.         numFrames:                LONGINT;                                {length in frames ( packetFrames or sampleFrames )}
  293.         AIFFSampleRate:            extended80;                                {IEEE sample rate}
  294.         markerChunk:            Ptr;                                    {sync track}
  295.         format:                    OSType;                                    {data format type, was futureUse1}
  296.         futureUse2:                LONGINT;                                {reserved by Apple}
  297.         stateVars:                StateBlockPtr;                            {pointer to State Block}
  298.         leftOverSamples:        LeftOverBlockPtr;                        {used to save truncated samples between compression calls}
  299.         compressionID:            INTEGER;                                {0 means no compression, non zero means compressionID}
  300.         packetSize:                INTEGER;                                {number of bits in compressed sample packet}
  301.         snthID:                    INTEGER;                                {resource ID of Sound Manager snth that contains NRT C/E}
  302.         sampleSize:                INTEGER;                                {number of bits in non-compressed sample}
  303.         sampleArea:                PACKED ARRAY [0..0] OF CHAR;            {space for when samples follow directly}
  304.     END;
  305.  
  306.     CmpSoundHeaderPtr = ^CmpSoundHeader;
  307.  
  308.     ExtSoundHeader = PACKED RECORD
  309.         samplePtr:                Ptr;                                    {if nil then samples are in sample area}
  310.         numChannels:            LONGINT;                                {number of channels,  ie mono = 1}
  311.         sampleRate:                UnsignedFixed;                            {sample rate in Apples Fixed point representation}
  312.         loopStart:                LONGINT;                                {same meaning as regular SoundHeader}
  313.         loopEnd:                LONGINT;                                {same meaning as regular SoundHeader}
  314.         encode:                    CHAR;                                    {data structure used , stdSH, extSH, or cmpSH}
  315.         baseFrequency:            CHAR;                                    {same meaning as regular SoundHeader}
  316.         numFrames:                LONGINT;                                {length in total number of frames}
  317.         AIFFSampleRate:            extended80;                                {IEEE sample rate}
  318.         markerChunk:            Ptr;                                    {sync track}
  319.         instrumentChunks:        Ptr;                                    {AIFF instrument chunks}
  320.         AESRecording:            Ptr;
  321.         sampleSize:                INTEGER;                                {number of bits in sample}
  322.         futureUse1:                INTEGER;                                {reserved by Apple}
  323.         futureUse2:                LONGINT;                                {reserved by Apple}
  324.         futureUse3:                LONGINT;                                {reserved by Apple}
  325.         futureUse4:                LONGINT;                                {reserved by Apple}
  326.         sampleArea:                PACKED ARRAY [0..0] OF CHAR;            {space for when samples follow directly}
  327.     END;
  328.  
  329.     ExtSoundHeaderPtr = ^ExtSoundHeader;
  330.  
  331.     ConversionBlock = RECORD
  332.         destination:            INTEGER;
  333.         unused:                    INTEGER;
  334.         inputPtr:                CmpSoundHeaderPtr;
  335.         outputPtr:                CmpSoundHeaderPtr;
  336.     END;
  337.  
  338.     ConversionBlockPtr = ^ConversionBlock;
  339.  
  340.     SMStatus = PACKED RECORD
  341.         smMaxCPULoad:            INTEGER;
  342.         smNumChannels:            INTEGER;
  343.         smCurCPULoad:            INTEGER;
  344.     END;
  345.  
  346.     SMStatusPtr = ^SMStatus;
  347.  
  348.     SCStatus = RECORD
  349.         scStartTime:            UnsignedFixed;
  350.         scEndTime:                UnsignedFixed;
  351.         scCurrentTime:            UnsignedFixed;
  352.         scChannelBusy:            BOOLEAN;
  353.         scChannelDisposed:        BOOLEAN;
  354.         scChannelPaused:        BOOLEAN;
  355.         scUnused:                BOOLEAN;
  356.         scChannelAttributes:    LONGINT;
  357.         scCPULoad:                LONGINT;
  358.     END;
  359.  
  360.     SCStatusPtr = ^SCStatus;
  361.  
  362.     AudioSelection = PACKED RECORD
  363.         unitType:                LONGINT;
  364.         selStart:                UnsignedFixed;
  365.         selEnd:                    UnsignedFixed;
  366.     END;
  367.  
  368.     FilePlayCompletionProcPtr = ProcPtr;  { PROCEDURE FilePlayCompletion(chan: SndChannelPtr); }
  369.     FilePlayCompletionUPP = UniversalProcPtr;
  370.  
  371. CONST
  372.     uppFilePlayCompletionProcInfo = $000000C0; { PROCEDURE (4 byte param); }
  373.  
  374. FUNCTION NewFilePlayCompletionProc(userRoutine: FilePlayCompletionProcPtr): FilePlayCompletionUPP;
  375.     {$IFC NOT GENERATINGCFM }
  376.     INLINE $2E9F;
  377.     {$ENDC}
  378.  
  379. PROCEDURE CallFilePlayCompletionProc(chan: SndChannelPtr; userRoutine: FilePlayCompletionUPP);
  380.     {$IFC NOT GENERATINGCFM}
  381.     INLINE $205F, $4E90;
  382.     {$ENDC}
  383.  
  384. TYPE
  385.     AudioSelectionPtr = ^AudioSelection;
  386.  
  387.     SndDoubleBuffer = PACKED RECORD
  388.         dbNumFrames:            LONGINT;
  389.         dbFlags:                LONGINT;
  390.         dbUserInfo:                ARRAY [0..1] OF LONGINT;
  391.         dbSoundData:            PACKED ARRAY [0..0] OF CHAR;
  392.     END;
  393.  
  394.     SndDoubleBufferPtr = ^SndDoubleBuffer;
  395.  
  396.     SndDoubleBackProcPtr = ProcPtr;  { PROCEDURE SndDoubleBack(channel: SndChannelPtr; doubleBufferPtr: SndDoubleBufferPtr); }
  397.     SndDoubleBackUPP = UniversalProcPtr;
  398.  
  399. CONST
  400.     uppSndDoubleBackProcInfo = $000003C0; { PROCEDURE (4 byte param, 4 byte param); }
  401.  
  402. FUNCTION NewSndDoubleBackProc(userRoutine: SndDoubleBackProcPtr): SndDoubleBackUPP;
  403.     {$IFC NOT GENERATINGCFM }
  404.     INLINE $2E9F;
  405.     {$ENDC}
  406.  
  407. PROCEDURE CallSndDoubleBackProc(channel: SndChannelPtr; doubleBufferPtr: SndDoubleBufferPtr; userRoutine: SndDoubleBackUPP);
  408.     {$IFC NOT GENERATINGCFM}
  409.     INLINE $205F, $4E90;
  410.     {$ENDC}
  411.  
  412. TYPE
  413.     SndDoubleBufferHeader = PACKED RECORD
  414.         dbhNumChannels:            INTEGER;
  415.         dbhSampleSize:            INTEGER;
  416.         dbhCompressionID:        INTEGER;
  417.         dbhPacketSize:            INTEGER;
  418.         dbhSampleRate:            UnsignedFixed;
  419.         dbhBufferPtr:            ARRAY [0..1] OF SndDoubleBufferPtr;
  420.         dbhDoubleBack:            SndDoubleBackUPP;
  421.     END;
  422.  
  423.     SndDoubleBufferHeaderPtr = ^SndDoubleBufferHeader;
  424.  
  425.     SndDoubleBufferHeader2 = PACKED RECORD
  426.         dbhNumChannels:            INTEGER;
  427.         dbhSampleSize:            INTEGER;
  428.         dbhCompressionID:        INTEGER;
  429.         dbhPacketSize:            INTEGER;
  430.         dbhSampleRate:            UnsignedFixed;
  431.         dbhBufferPtr:            ARRAY [0..1] OF SndDoubleBufferPtr;
  432.         dbhDoubleBack:            SndDoubleBackUPP;
  433.         dbhFormat:                OSType;
  434.     END;
  435.  
  436.     SndDoubleBufferHeader2Ptr = ^SndDoubleBufferHeader2;
  437.  
  438.     SoundInfoList = PACKED RECORD
  439.         count:                    INTEGER;
  440.         infoHandle:                Handle;
  441.     END;
  442.  
  443.     SoundInfoListPtr = ^SoundInfoList;
  444.  
  445.     CompressionInfo = RECORD
  446.         recordSize:                LONGINT;
  447.         format:                    OSType;
  448.         compressionID:            INTEGER;
  449.         samplesPerPacket:        INTEGER;
  450.         bytesPerPacket:            INTEGER;
  451.         bytesPerFrame:            INTEGER;
  452.         bytesPerSample:            INTEGER;
  453.         futureUse1:                INTEGER;
  454.     END;
  455.  
  456.     CompressionInfoPtr = ^CompressionInfo;
  457.  
  458.     CompressionInfoHandle = ^CompressionInfoPtr;
  459.  
  460. { These two routines for Get/SetSoundVol should no longer be used.}
  461. { They were for old Apple Sound Chip machines, and do not support the DSP or PowerMacs.}
  462. { Use Get/SetDefaultOutputVolume instead, if you must change the user's machine.}
  463. {$IFC OLDROUTINENAMES  & NOT GENERATINGCFM }
  464.  
  465. PROCEDURE SetSoundVol(level: INTEGER);
  466. PROCEDURE GetSoundVol(VAR level: INTEGER);
  467.     {$IFC NOT GENERATINGCFM}
  468.     INLINE $205F, $4218, $10B8, $0260;
  469.     {$ENDC}
  470. {$ENDC}
  471.  
  472. FUNCTION SndDoCommand(chan: SndChannelPtr; {CONST}VAR cmd: SndCommand; noWait: BOOLEAN): OSErr;
  473.     {$IFC NOT GENERATINGCFM}
  474.     INLINE $A803;
  475.     {$ENDC}
  476. FUNCTION SndDoImmediate(chan: SndChannelPtr; {CONST}VAR cmd: SndCommand): OSErr;
  477.     {$IFC NOT GENERATINGCFM}
  478.     INLINE $A804;
  479.     {$ENDC}
  480. FUNCTION SndNewChannel(VAR chan: SndChannelPtr; synth: INTEGER; init: LONGINT; userRoutine: SndCallBackUPP): OSErr;
  481.     {$IFC NOT GENERATINGCFM}
  482.     INLINE $A807;
  483.     {$ENDC}
  484. FUNCTION SndDisposeChannel(chan: SndChannelPtr; quietNow: BOOLEAN): OSErr;
  485.     {$IFC NOT GENERATINGCFM}
  486.     INLINE $A801;
  487.     {$ENDC}
  488. FUNCTION SndPlay(chan: SndChannelPtr; sndHdl: SndListHandle; async: BOOLEAN): OSErr;
  489.     {$IFC NOT GENERATINGCFM}
  490.     INLINE $A805;
  491.     {$ENDC}
  492. {$IFC OLDROUTINENAMES }
  493. FUNCTION SndAddModifier(chan: SndChannelPtr; modifier: Ptr; id: INTEGER; init: LONGINT): OSErr;
  494.     {$IFC NOT GENERATINGCFM}
  495.     INLINE $A802;
  496.     {$ENDC}
  497. {$ENDC}
  498. FUNCTION SndControl(id: INTEGER; VAR cmd: SndCommand): OSErr;
  499.     {$IFC NOT GENERATINGCFM}
  500.     INLINE $A806;
  501.     {$ENDC}
  502. { Sound Manager 2.0 and later, uses _SoundDispatch }
  503. { SndSoundManagerVersion() returns a NumVersion}
  504. FUNCTION SndSoundManagerVersion: LONGINT;
  505.     {$IFC NOT GENERATINGCFM}
  506.     INLINE $203C, $000C, $0008, $A800;
  507.     {$ENDC}
  508. FUNCTION SndStartFilePlay(chan: SndChannelPtr; fRefNum: INTEGER; resNum: INTEGER; bufferSize: LONGINT; theBuffer: UNIV Ptr; theSelection: AudioSelectionPtr; theCompletion: FilePlayCompletionUPP; async: BOOLEAN): OSErr;
  509.     {$IFC NOT GENERATINGCFM}
  510.     INLINE $203C, $0D00, $0008, $A800;
  511.     {$ENDC}
  512. FUNCTION SndPauseFilePlay(chan: SndChannelPtr): OSErr;
  513.     {$IFC NOT GENERATINGCFM}
  514.     INLINE $203C, $0204, $0008, $A800;
  515.     {$ENDC}
  516. FUNCTION SndStopFilePlay(chan: SndChannelPtr; quietNow: BOOLEAN): OSErr;
  517.     {$IFC NOT GENERATINGCFM}
  518.     INLINE $203C, $0308, $0008, $A800;
  519.     {$ENDC}
  520. FUNCTION SndChannelStatus(chan: SndChannelPtr; theLength: INTEGER; theStatus: SCStatusPtr): OSErr;
  521.     {$IFC NOT GENERATINGCFM}
  522.     INLINE $203C, $0510, $0008, $A800;
  523.     {$ENDC}
  524. FUNCTION SndManagerStatus(theLength: INTEGER; theStatus: SMStatusPtr): OSErr;
  525.     {$IFC NOT GENERATINGCFM}
  526.     INLINE $203C, $0314, $0008, $A800;
  527.     {$ENDC}
  528. PROCEDURE SndGetSysBeepState(VAR sysBeepState: INTEGER);
  529.     {$IFC NOT GENERATINGCFM}
  530.     INLINE $203C, $0218, $0008, $A800;
  531.     {$ENDC}
  532. FUNCTION SndSetSysBeepState(sysBeepState: INTEGER): OSErr;
  533.     {$IFC NOT GENERATINGCFM}
  534.     INLINE $203C, $011C, $0008, $A800;
  535.     {$ENDC}
  536. FUNCTION SndPlayDoubleBuffer(chan: SndChannelPtr; theParams: SndDoubleBufferHeaderPtr): OSErr;
  537.     {$IFC NOT GENERATINGCFM}
  538.     INLINE $203C, $0420, $0008, $A800;
  539.     {$ENDC}
  540. { MACE compression routines }
  541. { MACEVersion() returns a NumVersion}
  542. FUNCTION MACEVersion: LONGINT;
  543.     {$IFC NOT GENERATINGCFM}
  544.     INLINE $203C, $0000, $0010, $A800;
  545.     {$ENDC}
  546. PROCEDURE Comp3to1(inBuffer: UNIV Ptr; outBuffer: UNIV Ptr; cnt: LONGINT; inState: StateBlockPtr; outState: StateBlockPtr; numChannels: LONGINT; whichChannel: LONGINT);
  547.     {$IFC NOT GENERATINGCFM}
  548.     INLINE $203C, $0004, $0010, $A800;
  549.     {$ENDC}
  550. PROCEDURE Exp1to3(inBuffer: UNIV Ptr; outBuffer: UNIV Ptr; cnt: LONGINT; inState: StateBlockPtr; outState: StateBlockPtr; numChannels: LONGINT; whichChannel: LONGINT);
  551.     {$IFC NOT GENERATINGCFM}
  552.     INLINE $203C, $0008, $0010, $A800;
  553.     {$ENDC}
  554. PROCEDURE Comp6to1(inBuffer: UNIV Ptr; outBuffer: UNIV Ptr; cnt: LONGINT; inState: StateBlockPtr; outState: StateBlockPtr; numChannels: LONGINT; whichChannel: LONGINT);
  555.     {$IFC NOT GENERATINGCFM}
  556.     INLINE $203C, $000C, $0010, $A800;
  557.     {$ENDC}
  558. PROCEDURE Exp1to6(inBuffer: UNIV Ptr; outBuffer: UNIV Ptr; cnt: LONGINT; inState: StateBlockPtr; outState: StateBlockPtr; numChannels: LONGINT; whichChannel: LONGINT);
  559.     {$IFC NOT GENERATINGCFM}
  560.     INLINE $203C, $0010, $0010, $A800;
  561.     {$ENDC}
  562. { Sound Manager 3.0 and later calls }
  563. FUNCTION GetSysBeepVolume(VAR level: LONGINT): OSErr;
  564.     {$IFC NOT GENERATINGCFM}
  565.     INLINE $203C, $0224, $0018, $A800;
  566.     {$ENDC}
  567. FUNCTION SetSysBeepVolume(level: LONGINT): OSErr;
  568.     {$IFC NOT GENERATINGCFM}
  569.     INLINE $203C, $0228, $0018, $A800;
  570.     {$ENDC}
  571. FUNCTION GetDefaultOutputVolume(VAR level: LONGINT): OSErr;
  572.     {$IFC NOT GENERATINGCFM}
  573.     INLINE $203C, $022C, $0018, $A800;
  574.     {$ENDC}
  575. FUNCTION SetDefaultOutputVolume(level: LONGINT): OSErr;
  576.     {$IFC NOT GENERATINGCFM}
  577.     INLINE $203C, $0230, $0018, $A800;
  578.     {$ENDC}
  579. FUNCTION GetSoundHeaderOffset(sndHandle: SndListHandle; VAR offset: LONGINT): OSErr;
  580.     {$IFC NOT GENERATINGCFM}
  581.     INLINE $203C, $0404, $0018, $A800;
  582.     {$ENDC}
  583. FUNCTION UnsignedFixedMulDiv(value: UnsignedFixed; multiplier: UnsignedFixed; divisor: UnsignedFixed): UnsignedFixed;
  584.     {$IFC NOT GENERATINGCFM}
  585.     INLINE $203C, $060C, $0018, $A800;
  586.     {$ENDC}
  587. FUNCTION GetCompressionInfo(compressionID: INTEGER; format: OSType; numChannels: INTEGER; sampleSize: INTEGER; cp: CompressionInfoPtr): OSErr;
  588.     {$IFC NOT GENERATINGCFM}
  589.     INLINE $203C, $0710, $0018, $A800;
  590.     {$ENDC}
  591. FUNCTION SetSoundPreference(theType: OSType; VAR name: Str255; settings: Handle): OSErr;
  592.     {$IFC NOT GENERATINGCFM}
  593.     INLINE $203C, $0634, $0018, $A800;
  594.     {$ENDC}
  595. FUNCTION GetSoundPreference(theType: OSType; VAR name: Str255; settings: Handle): OSErr;
  596.     {$IFC NOT GENERATINGCFM}
  597.     INLINE $203C, $0638, $0018, $A800;
  598.     {$ENDC}
  599. { Sound Manager 3.1 and later calls }
  600. FUNCTION SndGetInfo(chan: SndChannelPtr; selector: OSType; infoPtr: UNIV Ptr): OSErr;
  601.     {$IFC NOT GENERATINGCFM}
  602.     INLINE $203C, $063C, $0018, $A800;
  603.     {$ENDC}
  604. FUNCTION SndSetInfo(chan: SndChannelPtr; selector: OSType; infoPtr: UNIV Ptr): OSErr;
  605.     {$IFC NOT GENERATINGCFM}
  606.     INLINE $203C, $0640, $0018, $A800;
  607.     {$ENDC}
  608. CONST
  609.     uppSndCallBackProcInfo = $000003C0; { PROCEDURE (4 byte param, 4 byte param); }
  610.  
  611. FUNCTION NewSndCallBackProc(userRoutine: SndCallBackProcPtr): SndCallBackUPP;
  612.     {$IFC NOT GENERATINGCFM }
  613.     INLINE $2E9F;
  614.     {$ENDC}
  615.  
  616. PROCEDURE CallSndCallBackProc(chan: SndChannelPtr; VAR cmd: SndCommand; userRoutine: SndCallBackUPP);
  617.     {$IFC NOT GENERATINGCFM}
  618.     INLINE $205F, $4E90;
  619.     {$ENDC}
  620.  
  621. {$ALIGN RESET}
  622. {$POP}
  623.  
  624. {$SETC UsingIncludes := SoundIncludes}
  625.  
  626. {$ENDC} {__SOUND__}
  627.  
  628. {$IFC NOT UsingIncludes}
  629.  END.
  630. {$ENDC}
  631.